/*
 * $QNXLicenseC:
 * Copyright 2018, QNX Software Systems. All Rights Reserved.
 * Copyright 2018 NXP
 *
 * You must obtain a written license from and pay applicable license fees to QNX
 * Software Systems before you may reproduce, modify or distribute this software,
 * or any work that includes all or part of this software.   Free development
 * licenses are available for evaluation and non-commercial purposes.  For more
 * information visit http://licensing.qnx.com or email licensing@qnx.com.
 *
 * This file may contain contributions from others.  Please review this entire
 * file for other proprietary rights or license notices, as well as the QNX
 * Development Suite License Guide at http://licensing.qnx.com/license-guide/
 * for other information.
 * $
 */

 #ifndef NXP_BOARD_H_
 #define NXP_BOARD_H_
 
#include <sys/slog.h>
#include <sys/slogcodes.h>

#if __GNUC__ >= 4
#define GCCATTR(x) __attribute__ ((x))
#else
#define GCCATTR(x)
#endif

// SYM_INTERNAL_ONLY indicates a function won't be called from outside this
// library, even via a function pointer.
#define SYM_INTERNAL_ONLY GCCATTR(visibility ("internal"))
#define SYM_PRIVATE GCCATTR(visibility ("hidden"))

/* debug control */
#ifdef CAPTURE_DEBUG_ON
    #define TRACE do { int temperrno=errno; slogf(_SLOGC_GRAPHICS, _SLOG_DEBUG2, "TRACE (imx8x board): %s()", __FUNCTION__); errno=temperrno; } while (0)
    #define LOG(...) do { int temperrno=errno; slogf(_SLOGC_GRAPHICS, _SLOG_DEBUG2, __VA_ARGS__); errno=temperrno; } while(0)
#else
    #define TRACE
    #define LOG(...)
#endif

enum {
	DEV0_TW2855_MIPI_CSI0 = 0,
	DEV1_TW2855_MIPI_CSI1 = 1,
	NDEVICES = 2
};

#define IMX6SDL_CAP_CHANNEL(x) (0x1 << x)

#define IMX_MIPI_DEVICE		0
SYM_INTERNAL_ONLY void logmsg( const char *fmt, ... ) __attribute__((__format__(__printf__, 1, 2)));

#endif



#define IMX6X_PLAT_UNKNOWN	-1
#define IMX6X_PLAT_IMX6D	0
#define IMX6X_PLAT_IMX6S	1

#if defined(__QNXNTO__) && defined(__USESRCVERSION)
#include <sys/srcversion.h>
__SRCVERSION("$URL: http://svn.ott.qnx.com/product/graphics/branches/release-2.1.x/hardware/wfd/imx8x/caplib/board/imx8x-nxp/board.h $ $Rev: 888499 $")
#endif
